1. Field of the Disclosure
The disclosure relates in general to a method of data sorting, and more particularly to a method of data sorting capable of solving the problem of sorting difference between different databases.
1. Description of the Related Art
The data stored in the database of a computer system has many different categories, such as special symbols, pure Arabic numerals, English letters and characters of East Asian languages (such as traditional/simplified Chinese characters, Japanese characters and Korean characters), or other languages. Currently, the default sorting orders between different databases may not be the same, and cannot satisfy specific needs. For instance, when a user would like to use a personal computer (PC) terminal, an Apple tablet PC or an -iPad terminal to obtain the structure code of the content stored at a server terminal, the user can browse the content of the database stored at the server terminal through the web. Since the database stored at the PC terminal and the database stored at the iPad terminal may not be sorted by the same order, the sorting results may be different and the user may be confused with data inquiry.
Let a sql server 2008 and a sqlite database be taken for example. Suppose string: {‘065’, ‘12’, ‘abc’, ‘@’, ‘ab12c’, ‘+’, ‘Zhang San’, ‘Li Si’} is to be inquired. According to the sql server 2008 database, the default sorting order is: {‘@’, ‘+’, ‘065’, ‘12’, ‘ab12c’, ‘abc’, ‘Zhang San’, ‘Li Si’}. According to the sqlite database, the default sorting order is: {‘+’, ‘065’, ‘12’, ‘@’, ‘ab12c’, ‘abc’, ‘Zhang San’, ‘Li Si’}. The default sorting orders are not the same for the two databases. Two databases would have different sorting results with regard to special characters, pure Arabic numerals and Chinese names. If the sorting difference is resolved by having the codes re-written in the program, the sorting task will become terrifically complicated, and the program performance will be reduced, thereby having impact on the user experience.